home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.0 KB | 50 lines | [TEXT/ttxt] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 3, example 1
-
- -- create a module so that names used previously will not conflict
- -- with names used here
- module Scratch10 uses ScriptX end
- in module Scratch10
-
- -- declare all the global variables we use in these examples
-
- global myStencil, rectangular, myNewRect, myOtherNewRect, rect1
- global myRect2, bigArray
-
- -- creating objects
-
- -- new method
- myStencil := new Path
- new LinkedList
-
- myRect2 := new Rect x2:500 y2:500
- bigArray := new Array initialSize:150
-
- rectangular := new TwoDShape \
- stencil:(new Rect x2:500 y2:500)
-
- -- object expression
- object (Rect) x1:35, y1:35, x2:50, y2:50 end
-
- object (Rect)
- x1:35, y1:35
- x2:50, y2:50
- end
-
- object (Array)
- initialSize:100
- growSize:10
- end
-
- object myNewRect (Rect) x2:100, y2:100 end
- myOtherNewRect := object (Rect) x2:100, y2:100 end
-
- rect1 := object (TwoDShape)
- fill:(new Brush color:redColor) -- keyword argument
- stroke:(new Brush color:greenColor) -- keyword argument
- settings
- x:50, y:50
- end
- -->>>